CSV2FXT SCRIPT

To achieve 99.0% modeling quality in backtesting using MetaTrader 4 (MT4), you can use Birt's CSV2FXT script. This process involves converting tick data into a format that MT4 can use for accurate backtesting. Here's a step-by-step guide on how to do this:

Prerequisites

  1. MetaTrader 4 Platform: Ensure you have MT4 installed on your computer.
  2. Birt's CSV2FXT Script: Download link is provided at the end/bottom of this page.
  3. Tick Data: Obtain tick data for your desired currency pair and time period. Popular sources include Dukascopy and TrueFX.
  4. Tickstory lite free version (optional but recommended).

Step-by-Step Guide

Step 1: Prepare Your Environment

  1. Install MetaTrader 4: Ensure MT4 is up and running on your machine.
  2. Download and Install Tickstory lite:

Step 2: Download Tick Data with Tickstory Lite

  1. Select Data Source: Open Tickstory Lite and select your desired currency pair and time period.
  2. Download Data: Click on the download icon. Ensure to set the export format to MetaTrader 4 or CSV if required.
  3. Data Quality: Tickstory Lite provides high-quality historical data suitable for backtesting.
  4. Export to MT4: After downloading, export the data directly to your MT4 installation for easy access.

Step 3: Convert CSV to FXT

  1. Place CSV2FXT Script:Copy the contents of the `mql4` folder within the `csv2fxt` folder and paste the three folders—`include`, `libraries`, and `scripts`—into the `MQL4` directory of your MT4 platform.
  2. Prepare CSV File: Ensure your CSV file is correctly formatted, typically with columns for date, time, bid, and ask prices.

Step 4: Run CSV2FXT Script

  1. Launch MT4: Open your MetaTrader 4 platform.
  2. Navigate to Scripts: Go to the Navigator panel, expand the Scripts section, and find CSV2FXT.
  3. Run the Script:
    • Drag the CSV2FXT script onto a chart of the currency pair for which you downloaded the data.
    • A settings window will appear. Configure the parameters, including the CSV File (it must be placed in the MQL4 folder mq4/files), timeframe, spread, and other relevant options.
    • Click "OK" to run the script. This will convert the CSV data into an FXT file that MT4 can use for backtesting.
Product 1 Product 2 Product 3

Step 5: Set Up Backtesting (Launch MT4 through Tickstory Lite)

  1. Launch MT4 via Tickstory Lite: Open Tickstory Lite and use the "Launch MT4" option to ensure your platform recognizes the tick data you've downloaded. This step is essential to achieve accurate backtest results.
  2. Open Strategy Tester: In MT4, go to View > Strategy Tester.
  3. Select Expert Advisor: Choose the EA you wish to test.
  4. Choose Currency Pair and Timeframe: Ensure these match the data you've converted.
  5. Set Model to "Every Tick": This option uses the generated FXT file for 99.0% modeling quality.
  6. Configure Other Settings: Adjust the date range, initial deposit, and other relevant settings.
  7. Run the Test: Click "Start" to begin the backtest.

Step 6: Analyze Results

  1. Check Modeling Quality: Ensure the report shows 99.0% modeling quality.
  2. Evaluate Performance: Analyze the results to understand how the EA performs under the tested conditions.

Tips for Success

  • Data Integrity: Ensure your tick data is complete and free of errors to achieve accurate results.
  • Spread and Commission: Set realistic values for spread and commission to reflect live trading conditions.
  • Use TDS Features: If using TDS, take advantage of features like variable spreads, slippage, and walk-forward analysis for more robust testing.

By following these steps, you should be able to achieve high modeling quality in your MT4 backtests, providing a more accurate representation of potential live trading performance.